/**
 * Author(s): xuming.Wong <xuming.Wong@gmail.com>
 * Origin source from MaNGOS(GPL2).
 * Copyright (C) 2005-2010 MaNGOS <http://getmangos.com/>
 */

#ifndef __MAP_REF_MANAGERH__
#define __MAP_REF_MANAGERH__

#include "RefManager.h"

namespace PQServiceCore
{
	class Map;
	class Player;
	class MapReference;

	class MapRefManager : public RefManager<Map, Player>
	{
		public:
			typedef LinkedListHead::Iterator< MapReference > iterator;
			typedef LinkedListHead::Iterator< MapReference const > const_iterator;

			MapReference* getFirst() { return (MapReference*)RefManager<Map, Player>::getFirst(); }
			MapReference const* getFirst() const { return (MapReference const*)RefManager<Map, Player>::getFirst(); }
			MapReference* getLast() { return (MapReference*)RefManager<Map, Player>::getLast(); }
			MapReference const* getLast() const { return (MapReference const*)RefManager<Map, Player>::getLast(); }

			iterator begin() { return iterator(getFirst()); }
			iterator end() { return iterator(NULL); }
			iterator rbegin() { return iterator(getLast()); }
			iterator rend() { return iterator(NULL); }
			const_iterator begin() const { return const_iterator(getFirst()); }
			const_iterator end() const  { return const_iterator(NULL); }
	};
}

#endif
